package com.biz.primus.model.coupon.vo.coupon;

import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;

/**
 * 用户优惠券列表Vo
 *
 * @author david-liu
 */
@ApiModel(value = "用户优惠券列表")
@Getter
@Setter
public class UserCouponListVo implements Serializable {
    private static final long serialVersionUID = 1617595782191763386L;

    @ApiModelProperty(hidden = true)
    private static final String USER_UNUSED_COUPON_KEY = "unused";

    @ApiModelProperty(hidden = true)
    private static final String USER_USED_COUPON_KEY = "used";

    @ApiModelProperty(hidden = true)
    private static final String USER_EXPIRED_COUPON_KEY = "expired";

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "用户优惠券集合")
    private Map<String, List<CouponVo>> userCoupons = new LinkedHashMap<String, List<CouponVo>>() {
        private static final long serialVersionUID = -7418913771059565261L;

        {
            put(USER_UNUSED_COUPON_KEY, Lists.newArrayList());
            put(USER_USED_COUPON_KEY, Lists.newArrayList());
            put(USER_EXPIRED_COUPON_KEY, Lists.newArrayList());
        }
    };

    public void setUserNotUsedCoupons(List<CouponVo> coupons) {
        userCoupons.put(USER_UNUSED_COUPON_KEY, coupons);
    }

    public void setUserUsedCoupons(List<CouponVo> coupons) {
        userCoupons.put(USER_USED_COUPON_KEY, coupons);
    }

    public void setUserExpiredCoupons(List<CouponVo> coupons) {
        userCoupons.put(USER_EXPIRED_COUPON_KEY, coupons);
    }
}
